package com.struct.factory
{
	import com.struct.graph.game.BattleFrame;
	import com.struct.graph.game.BattleGraphWorker;
	
	import sacu.s.Factory;
	
	public class BattleFactory extends Factory
	{
		public var battleGW:BattleGraphWorker;
		public var battle:BattleFrame;
		public function BattleFactory(Name:String)
		{
			super(Name);
		}
		
		override protected function onInitFactory():void{
			super.onInitFactory();
				
			battle = new BattleFrame();
			battleGW = new BattleGraphWorker("BattleGraphWorker", battle);
		}
		
		override protected function onStartFactory():void{
			registerGraphicsWorker(battleGW);
			SSA.application.mapLayer.addChild(battle);
		}
		override public function disposeFactory():void{
			super.disposeFactory();
			
			removeGraphicsWorker(battleGW.eName);
			SSA.application.mapLayer.removeChild(battle);
		}
	}
}